//======================================================================
//    This file is part of baijie_interface
//
//    Copyright (C) 2023 Shenzhen Baijie Technology Co., Ltd.All rights reserved.
//
//    filename : bluetooth_thread.cpp
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//======================================================================

#include "bluetooth_thread.h"

bluetooth_thread::bluetooth_thread(QObject *parent) : QObject(parent)
{
}

void bluetooth_thread::bluetooth_init_thread()
{
    g_bluetoothInterface->bluetoothInint();
}

QString bluetooth_thread::bluetooth_scan_thread()
{
    QString scanResult = g_bluetoothInterface->bluetoothScan();
    emit send_bluetooth_msg(EnumBtScanSignal,scanResult);
    return scanResult;
}

QString bluetooth_thread::bluetooth_pair_thread(QString btAddress)
{
    QString pairResult = g_bluetoothInterface->bluetoothPair(btAddress);
    emit send_bluetooth_msg(EnumBtPairSignal,pairResult);
    return pairResult;
}

QString bluetooth_thread::bluetooth_connect_thread(QString btAddress)
{
    QString connectResult = g_bluetoothInterface->bluetoothConnect(btAddress);
    emit send_bluetooth_msg(EnumBtConnectSignal,connectResult);
    return connectResult;
}
